package de.ars.client.screens;

import java.io.IOException;

import com.sun.lwuit.Form;
import com.sun.lwuit.Image;
import com.sun.lwuit.Label;
import com.sun.lwuit.layouts.BorderLayout;

import de.ars.client.Main;

/**
 * @author Dustin Augstein
 * 
 */

public class SplashScreen extends Form
{
    private Main parent;
    Label lbl_task = null;

    public SplashScreen( Main parent, String title )
    {
        setTitle( title );
        this.parent = parent;
        addContent();
    }

    private void addContent()
    {
        this.setLayout( new BorderLayout() );
        try
        {
            this.setBgImage( Image.createImage( "/default/images/bgt.png" ) );
        }
        catch( IOException e )
        {
            e.printStackTrace();
        }

        lbl_task = new Label();
        lbl_task.getStyle().setBgColor( 559295 );
        
        this.addComponent( BorderLayout.SOUTH, lbl_task );        
        this.show();
    }

    public void setTaskText( String text )
    {
        lbl_task.setText( text );
        this.repaint();
    }
}
